BigDFT.TB module

This module enables to compute the electronic properties of a solid state system using the matrices produced by a linear scaling calculation in BigDFT

class TightBinding(sys=<BigDFT.Systems.System object>, d=5)[source]
Defines the tight-binding object associated to

-a system (Systems.System) -an interaction radius (int)

class System(*args, **kwargs)

A system is defined as a named collection of fragments. You can manipulate a system as if it were a standard python dictionary, however it also has helper routines for performing operations on the full system.

map_sys(sys_e, r0_e=None, tol=0.1)[source]

Given two systems, finds the atom indices where the tb system maps the extended one.

Parameters:
  • sys_e (Systems.System) – the extended system

  • r0_e (3d-array) – the origin of self.sys in sys_e

  • tol (float) – tolerance for matching systems

Returns:

a mapping between the atom indices that minimize the associated error

Return type:

(dict)

shell_index(metadata)[source]

Given a mapping between atom sites and their periodic images, get their matrix indices from a linear-scaling calculation.

Parameters:

metadata (Spillage.MatrixMetadata) – the information on the matrices

shell_matrix(mat)[source]

Given a mapping between atom sites and their periodic images, get their matrices from a linear-scaling calculation.

Parameters:

mat (list) – the sparse matrices, H and S (scipy.sparse.csc_matrix)

Returns:

a mapping between atom sites and their matrices

Return type:

(dict)

compute_onsite_channels(v_sh, cp=0.99, sp=0.99)[source]

Given on-site eigenvectors, computes the distribution in terms of support functions (noted here as channels)

Parameters:
  • v_sh (numpy.array) – on-site eigenvectors

  • cp (float) – channel purity, the threshold to

  • pure (consider a channel as) –

  • sp (float) – sites purity, the threshold to

  • valid (consider a set of channels as) –

Returns:

maps for each eigenvec the smallest set of channels that meet the purity condition

Return type:

(dict)

k_path(hsp, n=101)[source]

Given a set of high-symmetry points, finds the k-path

Parameters:
  • hsp (dict) – the high-symmetry points labels and

  • coordinates

Returns:

the path in k-space

Return type:

(numpy.array)

k_matrix(k, m_sh)[source]

Given a mapping between atom sites and their perdiodic images, Bravais vectors and matrix elements, this function computes the k-resolved matrices

Parameters:
  • k (array) – the k-points sampling

  • m_sh (list) – a mapping between the atom sites and matrices

  • idmat (list) – orbitals number per atom

Returns:

The k-resolved matrices and energy spectrum

eigen(k, Hk, Sk, eigvals_only=True)[source]

Given the k_path, Hamiltonian and Overlap matrices, finds the eigenvals and eigenvecs (if specified).

Agrs:

k (numpy.array): the k_path Hk (numpy.array): the Hamiltonian matrix Sk (numpy.array): the Overlap matrix

Returns:

the eigvals and eigvecs

Return type:

(numpy.array)

spectral_weights(vk, mapping)[source]

Given eigenvecs, computes their spectral weights in terms of their support functions (SFs), depending on a mapping that defines the different group of SFs

Parameters:
  • vk (numpy.array) – the eigenvecs

  • mapping (dict) – written as {at: […]}, where the list

  • together (contains sub-list of SFs indices grouped) –

Returns:

the spectral weights

Return type:

(numpy.array)

spectral_map(cnk, Ek, dE=0.002, sig=0.3)[source]

Given spectral weights, computes a 2d map using Gaussiam smearing.

Parameters:
  • cnk (numpy.array) – the spectral weights

  • Ek (numpy.array) – the eigenvals

  • dE (floats) – the Gaussian smearing parameters

  • sig (floats) – the Gaussian smearing parameters

Returns:

energy interpolation wg (numpy.array): 2d map of spectral weights

Return type:

Eg (numpy.array)

k_norm(k_path)[source]

Given a k_path, computes its normalized vector

plot_bs(k_p, Ek, ax=None, prms={})[source]

Given a k-path and its eigenvals, plot the band structure

plot_spectral_map(k_p, Eg, wg, ax=None, cmap=['white', 'tab:blue'])[source]

Given a k-path and its interpolated eigenvals and spectral weights, plot the spectral map

show_eigen(v_sh)[source]

Given eigenvecs, plot the distribution in terms of support functions and their average weights